﻿using System;
using System.Collections.Generic;
using System.Text;
using CodePlex.Resourceful.Amazon.S3;

namespace CodePlex.Resourceful.Sun.CloudStorage
{
    public class SunCloudStorageClient : S3Client
    {
        

        private static Uri DefaultRootUri(bool useSSL)
        {
            return new Uri((useSSL ? "https" : "http") + "://" + SunCloudConstants.Host + "/");
        }

        public SunCloudStorageClient(string accessKeyID, string secretAccessKey)
            : this(accessKeyID, secretAccessKey, DefaultUseSSL)
        {

        }

        public  SunCloudStorageClient(string accessKeyID, string secretAccessKey,bool useSSL)
            : this(accessKeyID, secretAccessKey, useSSL, DefaultRetryStrategy)
        {
           
        }

        public SunCloudStorageClient(string accessKeyID, string secretAccessKey, bool useSSL, Func20<IRetryStrategy> retryStrategy)
            : this(accessKeyID, secretAccessKey, DefaultRootUri(useSSL), retryStrategy)
        {

        }

        public SunCloudStorageClient(string accessKeyID, string secretAccessKey, Uri rootUri, Func20<IRetryStrategy> retryStrategy)
            : base(accessKeyID,secretAccessKey,rootUri,retryStrategy)
        {

        

        }

        protected override S3ClientOptions Options
        {
            get
            {
                S3ClientOptions rt = new S3ClientOptions();
                rt.IncludeContentLengthForPuts = true;
                rt.UseAlternativeDateHeader = false;
                rt.BucketRequestsRequireTrailingSlash = true;
                rt.UrlEscapeUrl = false;
                return rt;
            }
        }

       
    }
}
